/*
 * @Description: 场地人口数量随时间变化的折线图
 * @Author: zy
 * @Date: 2021-04-06 14:15:16
 * @LastEditors: zy
 * @LastEditTime: 2021-04-06 14:40:00
 */
import * as echarts from 'echarts'
export class PeopleNumber {
  constructor (divId) {
    let chartDom = document.getElementById(divId)
    this.chart = echarts.init(chartDom)
  }
  //   let series = [{
  //     data: [820, 932, 901, 934, 1290, 1330, 1320],
  //     type: 'line',
  //     smooth: true
  //   },
  //   {
  //     data: [720, 912, 1101, 634, 290, 1130, 120],
  //     type: 'line',
  //     smooth: true
  //   }]
  // 设置option,主要是传入series,一些其他的设置例如dataZoom都在这里写
  setBaseOption (series) {
    let option = {
      'xAxis': {
        'type': 'category',
        'data': ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
      },
      'yAxis': {
        'type': 'value'
      },
      'series': series
    }
    return option
  }

  draw (option) {
    option && this.chart.setOption(option)
    return this.chart
  }
  // 获取刷取的dataZoom的范围,返回一个[start, end]
  getXaxisRange () {

  }
}
